package com.baowenli.mapper;

import com.baowenli.pojo.Room;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface HouseInfoMapper {

    /**
     *  查询所有房间状况信息
     */
    List<Room> selectAllHouseInfo();


    /**
     *  更改房间入住状态
     * */
    @ResultMap("brandResultMap")
    @Update("update room_info set room_status = #{status} where room_number = #{roomnumber};")
    boolean alterRoomStatus(@Param("roomnumber")int roomnumber,@Param("status")int status);


    /**
    *  通过房间信息找到价钱
    * */
    @ResultMap("brandResultMap")
    @Select("select * from room_info where room_id = #{roomid};")
    Room selectByRoomPrice(@Param("roomid")int roomid);

    /**
     *  更改房间入住状态
     * */
    /*@ResultMap("brandResultMap")
    @Update("update room_info set room_status = -1 where room_id = #{roomid};")
    boolean alterRoomStatus(@Param("roomid")int roomid);*/

}
